/*
 * tcc.cpp
 *
 * Main file for tcc, the general frontend to the turandot toolset.
 */

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "common.h"

void print_help();
void print_usage();

char *xname;
stopwatch_t *times;

int show_times = 0;

int main(int argc, char *argv[]) {
	xname = argv[0];
	times = stopwatch_create();
	stopwatch_start(times);

	int c;	
	opterr = 0;
	while ((c = getopt(argc, argv, "Tho:V")) != -1)
		switch (c) {
		case 'T':
			show_times = 1;
			break;
		case 'h':
			print_help();
			return 0;
		case 'V':
			print_version();
			return 0;
		case '?':
			switch (optopt) {
			case 'o':
				ferrf("-%c: argument required", optopt);
				break;
			default:
				ferrf("-%c: unknown option", optopt);
			}
		default:
			ferrf("unknown error (%s:%d)", __FILE__, __LINE__);
		}
	return 0;
}

void print_usage() {
	// TODO print some usage information
}

void print_help() {
	// TODO actually print some useful help
	print_usage();
}

